﻿Imports System.ServiceModel

<ComClass(ComProxy.ClassId, ComProxy.InterfaceId, ComProxy.EventsId)> _
Public Class ComProxy

#Region "COM GUIDs"
    ' These  GUIDs provide the COM identity for this class 
    ' and its COM interfaces. If you change them, existing 
    ' clients will no longer be able to access the class.
    Public Const ClassId As String = "9de2e4e3-828e-4796-9b19-488b2a187491"
    Public Const InterfaceId As String = "efa4d7ba-fd19-4575-9bc0-b5b33057c0ba"
    Public Const EventsId As String = "9b318021-bd71-49d3-b0bb-0138c02700ae"
#End Region

    ' A creatable COM class must have a Public Sub New() 
    ' with no parameters, otherwise, the class will not be 
    ' registered in the COM registry and cannot be created 
    ' via CreateObject.
    Public Sub New()
        MyBase.New()
    End Sub

    Public Function GetTime() As String

        Dim bs As New BasicHttpBinding
        Dim ea As New EndpointAddress("http://localhost:1053/WebSite1/Service.svc")
        Dim proxy = ChannelFactory(Of CustomProxy.ServiceProxy.IService).CreateChannel(bs, ea)
        Return proxy.DoWork()



    End Function

End Class


